import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.faces.model.SelectItem;

public class Repository {

	public static Map<String, Risk> allRisk;
	public static List<SelectItem> allRiskSelectItem;
	public static List<String> allHomeAppliances;
	public static List<String> allAroundRisk;

	static {
		allRisk = new HashMap<String, Risk>();
		allRisk.put("1", new Risk("1", "Riesgo 1", "Des 1"));
		allRisk.put("2", new Risk("2", "Riesgo 2", "Des 2"));
		allRisk.put("3", new Risk("3", "Riesgo 3", "Des 3"));
		allRisk.put("4", new Risk("4", "Riesgo 4", "Des 4"));
		allRisk.put("5", new Risk("5", "Riesgo 5", "Des 5"));

		allRiskSelectItem = new ArrayList<SelectItem>();
		Risk riskFind;
		for (Map.Entry<String, Risk> item : allRisk.entrySet()) {
			riskFind = item.getValue();
			allRiskSelectItem.add(new SelectItem(riskFind.getId(), riskFind
					.getNombre()));
		}

		allHomeAppliances = new ArrayList<String>();
		allHomeAppliances.add("Automovil");
		allHomeAppliances.add("Horno");
		allHomeAppliances.add("Microhondas");
		allHomeAppliances.add("Lavadora");
		allHomeAppliances.add("Computadora");
		allHomeAppliances.add("Cocina");

		allAroundRisk = new ArrayList<String>();
		allAroundRisk.add("Agua no clorada");
		allAroundRisk.add("Humos o vapores");
		allAroundRisk.add("Si alcantarillado");
		allAroundRisk.add("Desague");
		allAroundRisk.add("Basural");
		allAroundRisk.add("Vectores");
		allAroundRisk.add("Murcielago en vivienda");
		allAroundRisk.add("Ruidos");
		allAroundRisk.add("Derrumbes");
	}

	public static Risk getRisk(String key) {
		return allRisk.get(key);
	}

}
